package net.thellium.ddiameter.protocol.avp.parser;

public class Integer32Parser implements AVPValueParser {

	public Long parseValue(byte[] bytes) throws AvpDataException {
		if (bytes.length!=4) throw new AvpDataException();
		long ret = 0;
		for (int i = 0; i<4; i++) {
			ret += ParserUtils.unsignedByteValue(bytes[i]) << (8*(3-i));
		}
	
		return ret;
	}

}
